package com.prince.web.interceptor;

//import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class WebAppConfig extends WebMvcConfigurerAdapter{

//    @Value("${linux_imagesPath}")//linux_images_path=file:/D:/QuickEasyPay/img/
//    private String mImagesPath;
//	@Value("${linux_upload_image_path}")//project/upload/
//    private String linuxImagesPath;
//
//	@Override
//    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//        Properties properties = System.getProperties();
//        String os = properties.getProperty("os.name");
//		System.out.println("--------------------------映射路劲-----------------------");
//        if (os.contains("Windows")) {
//            registry.addResourceHandler("/upload/**").addResourceLocations(mImagesPath);
//            System.out.println(os + "环境：   " +mImagesPath);
//        }else{
//            System.out.println(os + "环境：   " +linuxImagesPath);
//            registry.addResourceHandler("/upload/**").addResourceLocations(linuxImagesPath);
//        }
//        super.addResourceHandlers(registry);
//    }
	
}
